﻿using DevExpress.Xpf.Grid;
using LibraryManagement.DataAccess;
using LibraryManagement.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace LibraryManagement.UI.Employee.Dialogs
{
    /// <summary>
    /// Interaction logic for AuthorSelectionDialog.xaml
    /// </summary>
    public partial class AuthorSelectionDialog : DevExpress.Xpf.Core.DXWindow
    {
        public List<Author> Result { get; set; }

        public AuthorSelectionDialog()
        {
            InitializeComponent();
            Result = new List<Author>();
        }

        private void AuthorSelection_Loaded(object sender, RoutedEventArgs e)
        {
            var _result = new BindingList<Author>();
            this.AuthorsGrid.ItemsSource = _result;

            foreach (var item in new AppDbContext().Authors.ToList())
            {
                _result.Add(item);
            }
        }

    }
}
